<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>CruiseControl.NET : Project Configuration Block</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            CruiseControl.NET : Project Configuration Block
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Jun 15, 2009 by <font color="#0050B2">csut017</font>.
				    </div>

				    <p>A <tt>&lt;project&gt;</tt> block defines all the configuration for one project running in a CruiseControl.NET server</p>

<h3><a name="ProjectConfigurationBlock-Examples"></a>Examples</h3>

<p>Minimalist example:
<br clear="all" /></p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;project name=<span class="code-quote">"Project 1"</span> /&gt;</span></pre>
</div></div>
<p>Full example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;project name=<span class="code-quote">"Project 1"</span> queue=<span class="code-quote">"Q1"</span> queuePriority=<span class="code-quote">"1"</span>&gt;</span>
    <span class="code-tag">&lt;workingDirectory&gt;</span>yourWorkingDirectory<span class="code-tag">&lt;/workingDirectory&gt;</span>
    <span class="code-tag">&lt;artifactDirectory&gt;</span>yourArtifactDirectory<span class="code-tag">&lt;/artifactDirectory&gt;</span>
    <span class="code-tag">&lt;category&gt;</span>Category 1<span class="code-tag">&lt;/category&gt;</span>
    <span class="code-tag">&lt;webURL&gt;</span>http://server1/ccnet/server/local/project/testProject/ViewLatestBuildReport.aspx<span class="code-tag">&lt;/webURL&gt;</span>
    <span class="code-tag">&lt;modificationDelaySeconds&gt;</span>2<span class="code-tag">&lt;/modificationDelaySeconds&gt;</span>
    <span class="code-tag">&lt;maxSourceControlRetries&gt;</span>5<span class="code-tag">&lt;/maxSourceControlRetries&gt;</span>
    <span class="code-tag">&lt;initialState&gt;</span>Stopped<span class="code-tag">&lt;/initialState&gt;</span>
    <span class="code-tag">&lt;startupMode&gt;</span>UseInitialState<span class="code-tag">&lt;/startupMode&gt;</span>
    <span class="code-tag">&lt;triggers&gt;</span>
        <span class="code-tag">&lt;yourFirstTriggerType ../&gt;</span>
        <span class="code-tag">&lt;yourOtherTriggerType ../&gt;</span>
    <span class="code-tag">&lt;/triggers&gt;</span>
    <span class="code-tag">&lt;state type=<span class="code-quote">"yourStateManagerType"</span> ../&gt;</span>
    <span class="code-tag">&lt;sourcecontrol type=<span class="code-quote">"yourSourceControlType"</span> ../&gt;</span>
    <span class="code-tag">&lt;labeller type=<span class="code-quote">"yourLabellerType"</span> ../&gt;</span>
    <span class="code-tag">&lt;prebuild&gt;</span>
        <span class="code-tag">&lt;yourFirstPrebuildTask ../&gt;</span>
        <span class="code-tag">&lt;yourOtherPrebuildTask ../&gt;</span>
    <span class="code-tag">&lt;/prebuild&gt;</span>
    <span class="code-tag">&lt;tasks&gt;</span>
        <span class="code-tag">&lt;yourFirstTask ../&gt;</span>
        <span class="code-tag">&lt;yourOtherTask ../&gt;</span>
    <span class="code-tag">&lt;/tasks&gt;</span>
    <span class="code-tag">&lt;publishers&gt;</span>
        <span class="code-tag">&lt;yourFirstPublisherTask ../&gt;</span>
        <span class="code-tag">&lt;yourOtherPublisherTask ../&gt;</span>
    <span class="code-tag">&lt;/publishers&gt;</span>
    <span class="code-tag">&lt;externalLinks&gt;</span>
        <span class="code-tag">&lt;externalLink name=<span class="code-quote">"My First Link"</span> url=<span class="code-quote">"http://somewhere/"</span> /&gt;</span>
        <span class="code-tag">&lt;externalLink name=<span class="code-quote">"My Other Link"</span> url=<span class="code-quote">"http://somewhere.else/"</span> /&gt;</span>
    <span class="code-tag">&lt;/externalLinks&gt;</span>
    <span class="code-tag">&lt;parameters&gt;</span>
        <span class="code-tag">&lt;textParameter name=<span class="code-quote">"Build Name"</span> default=<span class="code-quote">"Unknown"</span> /&gt;</span>
    <span class="code-tag">&lt;/parameters&gt;</span>
<span class="code-tag">&lt;/project&gt;</span></pre>
</div></div>

<h3><a name="ProjectConfigurationBlock-ConfigurationElements%3A"></a>Configuration Elements:</h3>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Node </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Required </th>
<th class='confluenceTh'> Default </th>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-name"></a> name </td>
<td class='confluenceTd'> The name of your project - this must be unique for any given CruiseControl.NET server </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> n/a </td>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-name"></a> queue </td>
<td class='confluenceTd'> The name of the <a href="Integration Queues.html" title="Integration Queues">integration queue</a> that this project will use. By default, each project runs in its own queue. (Added in CCNet 1.3) </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> the project name </td>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-name"></a> queuePriority </td>
<td class='confluenceTd'> The priority of this project within the integration queue. If multiple projects have pending requests in the specified queue then these requests will be executed according to their priority. Lower priority numbers indicate that integration requests for this project will execute before other projects in the same queue, however projects with priority 0 are always executed after projects with non-zero priorities in the same queue. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> 0 </td>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-workingDirectory"></a> workingDirectory </td>
<td class='confluenceTd'> The Working Directory for the project (this is used by other blocks). <b>Relative paths</b> are relative to a directory called the project Name in the directory where the CruiseControl.NET server was launched from. The Working Directory is meant to contain the checked out version of the project under integration. Make sure this folder us unique per project to prevent problems with the build. You don't need to quote the Working Directory, even if it contains spaces. <br clear="all" /> </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> <tt>WorkingDirectory</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-artifactDirectory"></a> artifactDirectory </td>
<td class='confluenceTd'> The Artifact Directory for the project (this is used by other blocks). <b>Relative paths</b> are relative to a directory called the project Name in the directory where the CruiseControl.NET server was launched from. The Artifact Directory is meant to be a persistence location for anything you want saved from the results of the build, e.g. build logs, distributables, etc. Make sure this folder us unique per project to prevent problems with reporting about a build. You don't need to quote the Aftifact Directory, even if it contains spaces. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> <tt>Artifacts</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-webURL"></a> webURL </td>
<td class='confluenceTd'> A reporting URL for this project. This is used by CCTray and the Email Publisher. Typically you should navigate to the Project Report on the Dashboard, and use its URL </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> <a href="http://localhost/ccnet">http://localhost/ccnet</a> </td>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-category"></a> category </td>
<td class='confluenceTd'> A general category for this project. This is used by the dashboard to provide groupings to the project. Categories do not span servers. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> empty string </td>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-modificationDelaySeconds"></a> modificationDelaySeconds </td>
<td class='confluenceTd'> The minimum number of seconds allowed between the last check in and the start of a valid build. <br clear="all" />
If any modifications are found within this interval the system will sleep long enough so the last checkin is just outside this interval. For example if the modification delay is set to 10 seconds and the last checkin was 7 seconds ago the system will sleep for 3 seconds and check again. This process will repeat until no modifications have been found within the modification delay window. <br clear="all" />
This feature is in CruiseControl.NET for Source Control systems, like CVS, that do not support atomic checkins since starting a build half way through someone checking in their work could result in invalid 'logical' passes or failures. The property is optional though so if you are using a source control system with atomic checkins, leave it out (and it will default to '0') </td>
<td class='confluenceTd'> integer </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> 0 </td>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-sourcecontrol"></a> sourcecontrol </td>
<td class='confluenceTd'> See <a href="Source Control Blocks.html" title="Source Control Blocks">Source Control Blocks</a> </td>
<td class='confluenceTd'> <a href="Source Control Blocks.html" title="Source Control Blocks">Source Control Block</a> </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> <a href="Null Source Control Block.html" title="Null Source Control Block">Null Source Control Block</a> </td>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-triggers"></a> triggers </td>
<td class='confluenceTd'> See <a href="Trigger Blocks.html" title="Trigger Blocks">Trigger Blocks</a> </td>
<td class='confluenceTd'> List of <a href="Trigger Blocks.html" title="Trigger Blocks">Trigger Blocks</a> </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> Specifying an empty element (&lt;triggers /&gt;) means integrations are only ever forced manually (for example using <a href="CCTray.html" title="CCTray">CCTray</a> or the <a href="Web Dashboard.html" title="Web Dashboard">Web Dashboard</a>.) Not including a <tt>&lt;triggers&gt;</tt> element at all means the project will behave like a &lt;triggers /&gt; element (before 1.4.3 the default when not inclufing a &lt;triggers&gt; was a single <a href="Interval Trigger.html" title="Interval Trigger">Interval Trigger</a> with default configuration). </td>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-state"></a> state </td>
<td class='confluenceTd'> See <a href="State Manager Blocks.html" title="State Manager Blocks">State Manager Blocks</a> </td>
<td class='confluenceTd'> <a href="State Manager Blocks.html" title="State Manager Blocks">State Manager Block</a> </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> Project State Manager </td>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-labeller"></a> labeller </td>
<td class='confluenceTd'> See <a href="Labeller Blocks.html" title="Labeller Blocks">Labeller Blocks</a> </td>
<td class='confluenceTd'> <a href="Labeller Blocks.html" title="Labeller Blocks">Labeller Block</a> </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> <a href="Default Labeller.html" title="Default Labeller">Default Labeller</a> </td>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-tasks"></a> tasks </td>
<td class='confluenceTd'> A set of <a href="Task Blocks.html" title="Task Blocks">Tasks</a> to run as part of the build. A failed task will fail the build and any subsequent tasks will not run. Tasks are run sequentially, in the order they appear in the configuration. </td>
<td class='confluenceTd'> List of <a href="Task Blocks.html" title="Task Blocks">Task Blocks</a> </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> empty list </td>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-prebuild"></a> prebuild </td>
<td class='confluenceTd'> A set of <a href="Task Blocks.html" title="Task Blocks">Tasks</a> to run before the build starts and before the source is updated. A failed task will fail the build and any subsequent tasks will not run. Tasks are run sequentially, in the order they appear in the configuration. &#42;This section is available in the CCNet 1.1 release. </td>
<td class='confluenceTd'> List of <a href="Task Blocks.html" title="Task Blocks">Task Blocks</a> </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> empty list </td>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-publishers"></a> publishers </td>
<td class='confluenceTd'> A set of <a href="Task Blocks.html" title="Task Blocks">Tasks</a> that are run after the build is complete.  These tasks are used primarily to clean up after the build and to publish and report on the build results.  All tasks in this section will always run regardless of whether previous tasks fail or the build is broken. You should <b>always</b> set an <a href="Xml Log Publisher.html" title="Xml Log Publisher">Xml Log Publisher</a> in this section so that your Web Dashboard will be able to report results. </td>
<td class='confluenceTd'> List of <a href="Task Blocks.html" title="Task Blocks">Task Blocks</a> </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> If you don't specify a &lt;publishers /&gt; section at all then a default <a href="Xml Log Publisher.html" title="Xml Log Publisher">Xml Log Publisher</a> is used as the sole publisher. </td>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-externalLinks"></a> externalLinks </td>
<td class='confluenceTd'> See <a href="ExternalLinks.html" title="ExternalLinks">ExternalLinks</a> </td>
<td class='confluenceTd'> List of <a href="ExternalLinks.html" title="ExternalLinks">ExternalLinks</a> </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> empty list </td>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-maxSourceControlRetries"></a> maxSourceControlRetries <br clear="all" /> </td>
<td class='confluenceTd'> The maximum amount of source control exceptions in a row that may occur, before the project goes to the stopped state(when stopProjectOnReachingMaxSourceControlRetries is set to true). <br clear="all" /> </td>
<td class='confluenceTd'> int </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> 5 </td>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-initialState"></a> initialState<br clear="all" /> </td>
<td class='confluenceTd'> Sets the state of the project when CCNet service/Console starts. Stopped can be handy when you are adding a lot of projects which are depending on other projects (via the project trigger) and these may not be build right away. This value is only used when startupMode is set to UseInitialState. <br clear="all" /> </td>
<td class='confluenceTd'> enum </td>
<td class='confluenceTd'> no <br clear="all" /> </td>
<td class='confluenceTd'> Started. <br clear="all" />
Possible values are : <br clear="all" />
&nbsp; Stopped <br clear="all" />
&nbsp; Started <br clear="all" /> </td>
</tr>
<tr>
<td class='confluenceTd'> <a name="ProjectConfigurationBlock-startupMode"></a> startupMode<br clear="all" /> </td>
<td class='confluenceTd'> The start-up mode to use. <br clear="all" /> </td>
<td class='confluenceTd'> enum </td>
<td class='confluenceTd'> no <br clear="all" /> </td>
<td class='confluenceTd'> UseLastState. <br clear="all" />
Possible values are : <br clear="all" />
&nbsp; UseInitialState <br clear="all" />
&nbsp; UseLastState <br clear="all" /> </td>
</tr>
<tr>
<td class='confluenceTd'> stopProjectOnReachingMaxSourceControlRetries<br clear="all" /> </td>
<td class='confluenceTd'> Stops the project on reaching maxSourceControlRetries or not. When set to true, the project will be stopped when the amount of consecutive source control errors is equal to maxSourceControlRetries.<br clear="all" /> </td>
<td class='confluenceTd'> bool </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> sourceControlErrorHandling<br clear="all" /> </td>
<td class='confluenceTd'> What action to take when a source control error occurs (during GetModifications). These are the possible values :<br clear="all" />
<ul>
	<li>ReportEveryFailure : runs the publisher section whenever there is an error</li>
	<li>ReportOnRetryAmount : only runs the publisher section when maxSourceControlRetries has been reached,<br clear="all" />
 &nbsp;&nbsp;&nbsp; the publisher section will only be run once.</li>
	<li>ReportOnEveryRetryAmount : runs the publisher section whenever the maxSourceControlRetries has been&nbsp;&nbsp; reached. When maxSourceControlRetries has been reached and the publisher section has ran, the counter is set back to 0.</li>
</ul>
</td>
<td class='confluenceTd'> enum </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> ReportEveryFailure </td>
</tr>
<tr>
<td class='confluenceTd'> parameters </td>
<td class='confluenceTd'> Dynamic build parameters - these are parameters that are set at build time instead of being hard-coded within the configuration file </td>
<td class='confluenceTd'> Array of parameters - see <a href="Dynamic Parameters.html" title="Dynamic Parameters">Dynamic Parameters</a> </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
</tr>
</tbody></table>

<h3><a name="ProjectConfigurationBlock-SettingtheWebURL"></a>Setting the WebURL</h3>

<p>The current format of the url for a project, as specified in the &lt;webURL&gt; element is:</p>

<p><div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">http:<span class="code-comment">//&lt;dashboardserver&gt;/&lt;vdir&gt;/server/&lt;ccnetserver&gt;/project/&lt;projectname&gt;/ViewLatestBuildReport.aspx</span></pre>
</div></div><br clear="all" />
For example, if the dashboard was deployed on the server <b>webserver</b> to virtual directory <b>ccnet</b>, and if the project to monitor is called <b>test</b> on server <b>cruise</b>, the URL would be:
<br clear="all" /></p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">http:<span class="code-comment">//webserver/ccnet/server/cruise/project/test/ViewLatestBuildReport.aspx</span></pre>
</div></div>

<h3><a name="ProjectConfigurationBlock-Subsectiontypes"></a>Sub-section types</h3>

<ul><li><a href="Dynamic Parameters.html" title="Dynamic Parameters">Dynamic Parameters</a></li><li><a href="ExternalLinks.html" title="ExternalLinks">ExternalLinks</a></li><li><a href="Labeller Blocks.html" title="Labeller Blocks">Labeller Blocks</a></li><li><a href="Source Control Blocks.html" title="Source Control Blocks">Source Control Blocks</a></li><li><a href="State Manager Blocks.html" title="State Manager Blocks">State Manager Blocks</a></li><li><a href="Task Blocks.html" title="Task Blocks">Task Blocks</a></li><li><a href="Timeout Configuration.html" title="Timeout Configuration">Timeout Configuration</a></li><li><a href="Trigger Blocks.html" title="Trigger Blocks">Trigger Blocks</a></li></ul>

				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="http://confluence.public.thoughtworks.org//images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Sep 29, 2009 20:59</font></td>
		    </tr>
	    </table>
    </body>
</html>